﻿namespace SLClient.CustomerControls
{
    using SLClient.Infrastructure;
    using System;
    using System.Linq.Expressions;
    using System.Reflection;

    public class PlayData : ViewModelBase
    {
        private string _bonusNumber = "";
        private DateTime _endTime = DateTime.Now;
        private int _lotterCatagoryId = 0;
        private DateTime _openTime = DateTime.Now;
        private string _qh = "";
        private DateTime _startTime = DateTime.Now;

        public string BigOrLitter
        {
            get
            {
                if (this.BonusNumber == "")
                {
                    return "";
                }
                string[] strArray = this.BonusNumber.Split(new char[] { ',' });
                if (strArray.Length == 0)
                {
                    return "单";
                }
                return (((Convert.ToInt32(strArray[strArray.Length - 1]) % 2) != 0) ? "单" : "双");
            }
        }

        public string BonusNumber
        {
            get
            {
                return this._bonusNumber;
            }
            set
            {
                this._bonusNumber = value;
                base.Notify<string>(() => this.BonusNumber);
                //base.Notify<string>(System.Linq.Expressions.Expression.Lambda<Func<string>>(System.Linq.Expressions.Expression.Property(System.Linq.Expressions.Expression.Constant(this, typeof(PlayData)), (MethodInfo)(PlayData.get_BonusNumber)), new ParameterExpression[0]));
            }
        }

        public string DanOrShuang
        {
            get
            {
                if (this.BonusNumber == "")
                {
                    return "";
                }
                string[] strArray = this.BonusNumber.Split(new char[] { ',' });
                if (strArray.Length == 0)
                {
                    return "大";
                }
                return ((Convert.ToInt32(strArray[strArray.Length - 1]) >= 5) ? "大" : "小");
            }
        }

        public DateTime EndTime
        {
            get
            {
                return this._endTime;
            }
            set
            {
                this._endTime = value;
                base.Notify<DateTime>(() => this.EndTime);
                //base.Notify<DateTime>(System.Linq.Expressions.Expression.Lambda<Func<DateTime>>(System.Linq.Expressions.Expression.Property(System.Linq.Expressions.Expression.Constant(this, typeof(PlayData)), (MethodInfo)(PlayData.get_EndTime)), new ParameterExpression[0]));
            }
        }

        public int LotterCatagoryId
        {
            get
            {
                return this._lotterCatagoryId;
            }
            set
            {
                this._lotterCatagoryId = value;
                base.Notify<int>(() => this.LotterCatagoryId);
                //base.Notify<int>(System.Linq.Expressions.Expression.Lambda<Func<int>>(System.Linq.Expressions.Expression.Property(System.Linq.Expressions.Expression.Constant(this, typeof(PlayData)), (MethodInfo)(PlayData.get_LotterCatagoryId)), new ParameterExpression[0]));
            }
        }

        public DateTime OpenTime
        {
            get
            {
                return this._openTime;
            }
            set
            {
                this._openTime = value;
                base.Notify<DateTime>(() => this.OpenTime);
                //base.Notify<DateTime>(System.Linq.Expressions.Expression.Lambda<Func<DateTime>>(System.Linq.Expressions.Expression.Property(System.Linq.Expressions.Expression.Constant(this, typeof(PlayData)), (MethodInfo)(PlayData.get_OpenTime)), new ParameterExpression[0]));
            }
        }

        public string Qh
        {
            get
            {
                return this._qh;
            }
            set
            {
                this._qh = value;
                base.Notify<string>(() => this.Qh);
                //base.Notify<string>(System.Linq.Expressions.Expression.Lambda<Func<string>>(System.Linq.Expressions.Expression.Property(System.Linq.Expressions.Expression.Constant(this, typeof(PlayData)), (MethodInfo)(PlayData.get_Qh)), new ParameterExpression[0]));
            }
        }

        public DateTime StartTime
        {
            get
            {
                return this._startTime;
            }
            set
            {
                this._startTime = value;
                base.Notify<DateTime>(() => this.StartTime);
                //base.Notify<DateTime>(System.Linq.Expressions.Expression.Lambda<Func<DateTime>>(System.Linq.Expressions.Expression.Property(System.Linq.Expressions.Expression.Constant(this, typeof(PlayData)), (MethodInfo)(PlayData.get_StartTime)), new ParameterExpression[0]));
            }
        }
    }
}

